package demo1;

public class demo7 {
    public static void main(String[] args) {

        double[] array = new double[]{1,0,2,5,3.8,4.5,0,5,0};
        double sum = getSum(array);
        System.out.println("总分是：" + sum);

        double[] array1 =  new double[] {67,88,99,75,88.5,99.1,59.9,100,0.0};
        double sum1 = getSum(array1);
        System.out.println("总分是："+sum1);
    }
    public static double getSum(double[] array) {
        double sum = 0.0;
        for (int i = 0; i < array.length; i++) {
          sum += array[i];
        }
        return sum;
    }
}
